#ifndef RCVDATA_H
#define RCVDATA_H

#include <QObject>
#include <QDebug>
#include <QTime>
#include <QtNetwork/QTcpSocket>
#include <QByteArray>
#include <QSettings>
#include <QTimer>
#include "header.h"

class RcvData : public QObject
{
    Q_OBJECT
public:
    explicit RcvData(QObject *parent = NULL);
    RcvData(QTcpSocket *Sock);

    // 函数
    void Init();
    void CloseScoket();

private:
    // 变量
    QTcpSocket *SockData;
    QTimer *RcvTimer;
    unsigned int RcvCnt;
    // 函数

signals:
    void SendData(QByteArray Data);
    void ConnectError();
    void ConnectRight();

public slots:
    void SlotConnect();
    void SlotErr(QAbstractSocket::SocketError err);
    void SlotDisconnect();
    void SlotReadData();
    void RcvTimerOut();
};

#endif // RCVDATA_H
